<!doctype html>
<html>
	<head>
		<meta charset="utf-8">
		<title>飞机大战</title>
	</head>
	<body>		
		<script>
		//创建数组fruit
		var fruit=["苹果","香蕉","橘子","葡萄","菠萝"];
		fruit.length=3;
		fruit[fruit.length]="柚子";
		//使用for循环遍历数组
		for(var i=0;i<fruit.length;i++){
			document.write(fruit[i]+"  ");
		}
		
		
		</script>
	</body>
</html>